#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>
#include<vector>

using namespace std;

vector<int> divisibilityArray(string word, int m) {
    vector<int> res(word.size(), 0);
    long long tmp = 0;
    for (int i = 0; i < word.size(); i++)
    {
        tmp = (tmp * 10 + word[i] - '0') % m;
        if (tmp == 0)
            res[i] = 1;
    }
    return res;
}